<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>专业管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			//$("#name").focus();
			$("#inputForm").validate({
				submitHandler: function(form){
					loading('正在提交，请稍等...');
					form.submit();
				},
				errorContainer: "#messageBox",
				errorPlacement: function(error, element) {
					$("#messageBox").text("输入有误，请先更正。");
					if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
						error.appendTo(element.parent().parent());
					} else {
						error.insertAfter(element);
					}
				}
			});
			//给专业类别绑定change事件
			$("#disciplineFields").on('change', 'select', function(){
				selectChange(this,'${ctx}/university/majorCategory/listDataBySelecteddisciplineFields','majorCategory','majorCategory.id');
			});
		});
	</script>
	<script type="text/javascript" src="${ctxStatic}/js/wending/common.js"></script>
	<script type="text/javascript" src="${ctxStatic}/js/wending/linkage.js"></script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li><a href="${ctx}/university/major/">专业列表</a></li>
		<li class="active"><a href="${ctx}/university/major/form?id=${major.id}">专业<shiro:hasPermission name="university:major:edit">${not empty major.id?'修改':'添加'}</shiro:hasPermission><shiro:lacksPermission name="university:major:edit">查看</shiro:lacksPermission></a></li>
	</ul><br/>
	<form:form id="inputForm" modelAttribute="major" action="${ctx}/university/major/save" method="post" class="form-horizontal">
		<form:hidden path="id"/>
		<sys:message content="${message}"/>		
		<div class="control-group">
			<label class="control-label">学历层次：</label>
			<div class="controls">
				<form:select path="xueLiLevel.id" class="input-xlarge required" onchange="selectChange(this,'${ctx}/university/disciplineFields/listDataBySelectedXueLiLevel','disciplineFields','disciplineFields.id')">
					<form:option value="" label=""/>
					<form:options items="${fns:getXueLiLevelList()}" itemLabel="name" itemValue="id" htmlEscape="false"/>
				</form:select>
				<span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">学科门类：</label>
			<div class="controls" id="disciplineFields">
				<c:if test="${not empty major.xueLiLevel.id}">
				<form:select path="disciplineFields.id" class="input-xlarge required" onchange="selectChange(this,'${ctx}/university/majorCategory/listDataBySelecteddisciplineFields','majorCategory','majorCategory.id')">
					<form:option value="" label=""/>
					<form:options items="${fns:getDisciplineFieldsListByXueLi(majorCategory.xueLiLevel.id)}" itemLabel="name" itemValue="id" htmlEscape="false"/>
				</form:select>
				<span class="help-inline"><font color="red">*</font> </span>
				</c:if>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">专业类别：</label>
			<div class="controls" id="majorCategory">
				<c:if test="${not empty major.disciplineFields.id}">
					<form:select path="majorCategory.id" class="input-xlarge required">
						<form:option value="" label=""/>
						<form:options items="${fns:getMajorCategoryListByDfId(major.disciplineFields.id)}" itemLabel="name" itemValue="id" htmlEscape="false"/>
					</form:select>
					<span class="help-inline"><font color="red">*</font></span>
				</c:if>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">序号：</label>
			<div class="controls">
				<form:input path="sequence" htmlEscape="false" class="input-xlarge required digits"/>
				<span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">专业：</label>
			<div class="controls">
				<form:input path="name" htmlEscape="false" maxlength="255" class="input-xlarge required"/>
				<span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">修学年限：</label>
			<div class="controls">
				<form:input path="year" htmlEscape="false" maxlength="20" class="input-xlarge required"/>
				<span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">授予学位：</label>
			<div class="controls">
				<form:input path="degree" htmlEscape="false" maxlength="50" class="input-xlarge required"/>
				<span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">专业培养目标：</label>
			<div class="controls">
				<form:textarea path="target" htmlEscape="false" rows="4" maxlength="1000" class="input-xxlarge required"/>
				<span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">主要课程：</label>
			<div class="controls">
				<form:textarea path="curriculum" htmlEscape="false" rows="4" maxlength="1000" class="input-xxlarge required"/>
				<span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">毕业生应具备以下的知识和能力：</label>
			<div class="controls">
				<form:textarea path="knowledge" htmlEscape="false" rows="4" maxlength="1000" class="input-xxlarge"/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">就业前景和方向：</label>
			<div class="controls">
				<form:textarea path="prospects" htmlEscape="false" rows="4" maxlength="1000" class="input-xxlarge required"/>
				<span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">专业排名：</label>
			<div class="controls">
				<form:textarea path="ranking" htmlEscape="false" rows="4" class="input-xxlarge "/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">特设：</label>
			<div class="controls">
				<form:radiobuttons path="adHoc" items="${fns:getDictList('yes_no')}" itemLabel="label" itemValue="value" htmlEscape="false" class="required"/>
				<span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div>
		<div class="form-actions">
			<shiro:hasPermission name="university:major:edit"><input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存"/>&nbsp;</shiro:hasPermission>
			<input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
		</div>
	</form:form>
</body>
</html>